package com.asterisk;

import java.rmi.RemoteException;
import java.util.HashMap;

import com.protocols.sctp.m3ua.sccp.tcap.camel.BCSMEvent;
import com.protocols.sctp.m3ua.sccp.tcap.camel.CamelRequestReportBCSMEvent;

public class ChannelInfo {
	
	private Boolean Answered=false;
	private Boolean ApplyCharging=false;
	private Boolean ChannelTypeOriginating=true;
	private long TimeLeft=0;
	private long StartTime=0;
	private Boolean ReleaseifDurationExceed=false;
	private int PartytoCharge=0;
	private int LastInvokedID=0;
	private Boolean BalanceExhausted=false;
	public HashMap<Long,BCSMEvent> EventInfo = new HashMap<Long,BCSMEvent>();
	
	
	public ChannelInfo(CamelRequestReportBCSMEvent events){
		
		
	}
	
	
	public void addBCSMEvents(CamelRequestReportBCSMEvent events){
		
		if (events.BCSMEvent1.getEventType()!=0)
			EventInfo.put(events.BCSMEvent1.getEventType(), events.BCSMEvent1);
		if (events.BCSMEvent2.getEventType()!=0)
			EventInfo.put(events.BCSMEvent2.getEventType(), events.BCSMEvent2);
		if (events.BCSMEvent1.getEventType()!=0)
			EventInfo.put(events.BCSMEvent3.getEventType(), events.BCSMEvent3);
		if (events.BCSMEvent3.getEventType()!=0)
			EventInfo.put(events.BCSMEvent2.getEventType(), events.BCSMEvent2);
		if (events.BCSMEvent4.getEventType()!=0)
			EventInfo.put(events.BCSMEvent4.getEventType(), events.BCSMEvent4);
		if (events.BCSMEvent5.getEventType()!=0)
			EventInfo.put(events.BCSMEvent5.getEventType(), events.BCSMEvent5);
		if (events.BCSMEvent6.getEventType()!=0)
			EventInfo.put(events.BCSMEvent6.getEventType(), events.BCSMEvent6);
		if (events.BCSMEvent7.getEventType()!=0)
			EventInfo.put(events.BCSMEvent7.getEventType(), events.BCSMEvent7);
		if (events.BCSMEvent8.getEventType()!=0)
			EventInfo.put(events.BCSMEvent8.getEventType(), events.BCSMEvent8);
		if (events.BCSMEvent9.getEventType()!=0)
			EventInfo.put(events.BCSMEvent9.getEventType(), events.BCSMEvent9);
		if (events.BCSMEvent10.getEventType()!=0)
			EventInfo.put(events.BCSMEvent10.getEventType(), events.BCSMEvent10);
		
		
		
	}
	
	public void setApplyChargingInfo(long timeleft, Boolean releaseifDurationExceed, int partytoCharge){
		TimeLeft=timeleft;
		ReleaseifDurationExceed=releaseifDurationExceed;
		PartytoCharge=partytoCharge;
		setApplyCharging(true);
		
	}
	

	public Boolean applyCharging() {
		return ApplyCharging;
	}

	public void setApplyCharging(Boolean applyCharging) {
		ApplyCharging = applyCharging;
	}

	public long getTimeLeft() {
		return TimeLeft;
	}

	public void setTimeLeft(long timeLeft) {
		TimeLeft = timeLeft;
	}

	public long getStartTime() {
		return StartTime;
	}

	public void setStartTime(long startTime) {
		StartTime = startTime;
	}

	public Boolean getReleaseifDurationExceed() {
		return ReleaseifDurationExceed;
	}

	public void setReleaseifDurationExceed(Boolean releaseifDurationExceed) {
		ReleaseifDurationExceed = releaseifDurationExceed;
	}

	public int getPartytoCharge() {
		return PartytoCharge;
	}

	public void setPartytoCharge(int partytoCharge) {
		PartytoCharge = partytoCharge;
	}

	public Boolean getAnswered() {
		return Answered;
	}

	public void setAnswered(Boolean answered) {
		Answered = answered;
	}

	public int getLastInvokedID() {
		return LastInvokedID;
	}

	public void setLastInvokedID(int lastInvokedID) {
		LastInvokedID = lastInvokedID;
	}


	public Boolean getBalanceExhausted() {
		return BalanceExhausted;
	}


	public void setBalanceExhausted(Boolean balanceExhausted) {
		BalanceExhausted = balanceExhausted;
	}


	public Boolean isChannelTypeOriginating() {
		return ChannelTypeOriginating;
	}


	public void setChannelTypeOriginating(Boolean channelTypeOriginating) {
		ChannelTypeOriginating = channelTypeOriginating;
	}
}
